﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;

namespace DAO
{
    public class REGISTER_MAILDAO
    {
        public static bool DaDangKy(String emailNew,String city)
        {
            DataClassesNHOMMUADataContext db = new DataClassesNHOMMUADataContext();
            var temp = db.usp_CheckResEmail(emailNew,city);
            if (temp.Count() > 0)
            {
                return true;
            }
            return false;
        }

        public static int DangKyNhanTinKM(REGISTER_MAIL New)
        {
            DataClassesNHOMMUADataContext db = new DataClassesNHOMMUADataContext();
            int res = db.usp_InsertRegEmail(New.EMAIL, New.CITY);                
            return res;
        }
    }
}
